Skip to content

fix(chaos-castle): rank the survivors before the dead players - #1623

Open
openmubr wants to merge 1 commit into
MUnique:masterfrom
openmubr:fix/chaos-castle-survivor-ranking
Open

openmubr wants to merge 1 commit into
MUnique:masterfrom
openmubr:fix/chaos-castle-survivor-ranking

Conversation

@openmubr

Copy link
Copy Markdown
Contributor

Problem
At the end of a Chaos Castle, the last player standing can be shown the "failed" result and get the rewards of a lower rank, even though he won.

Cause
Players who died stay registered in the mini game until they leave the map. ChaosCastleContext.GameEndedAsync ordered all finishers by score only. A dead player with a higher score (monster kills give 2 points, player kills give 1) ranked first, became the winner, and pushed the survivor down.

Fix
Order the finishers by being alive first, then by score. If time runs out, the best-scoring survivor wins.

Testing
MUnique.OpenMU.GameLogic builds without errors. I did not reproduce it in a running game, and I did not add a unit test, because the ordering is inside the event context, which has no existing test setup.

🤖 Generated with Claude Code

Players who died stay registered in the mini game until they leave the map.
GameEndedAsync ordered the finishers by score only, so a dead player with more
points (monster kills give 2, player kills give 1) ranked first. He became the
winner and the last survivor got the "failed" result and the rewards of a lower
rank.

Order the finishers by being alive first, then by score.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant